#titlebar {
	background: #1a2933;
	display: block;
	position: fixed;
	height: 32px;
	width: calc(100% - 2px);
	z-index: 10000;
}

.maximized #titlebar {
	width: 100%;
	padding: 0;
}

#titlebar {
	padding: 4px;
}

#titlebar #drag-region {
	width: 100%;
	height: 100%;
	-webkit-app-region: drag;
}

#titlebar {
	color: #fff;
}

#titlebar #drag-region {
	display: grid;
	grid-template-columns: auto 138px;
}

#window-title {
	grid-column: 1;
	display: flex;
	align-items: center;
	margin-left: 8px;
	overflow: hidden;
	font-family: "Segoe UI", sans-serif;
	font-size: 12px;
}

.maximized #window-title {
	margin-left: 12px;
}

#window-title span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	line-height: 1.5;
}

#window-controls {
	display: grid;
	grid-template-columns: repeat(3, 46px);
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
}

#window-controls {
	-webkit-app-region: no-drag;
}

#window-controls .button {
	grid-row: 1 / span 1;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	height: 100%;
}

@media (-webkit-device-pixel-ratio: 1.5),
	(device-pixel-ratio: 1.5),
	(-webkit-device-pixel-ratio: 2),
	(device-pixel-ratio: 2),
	(-webkit-device-pixel-ratio: 3),
	(device-pixel-ratio: 3) {
	#window-controls .icon {
		width: 10px;
		height: 10px;
	}
}

#window-controls .button {
	user-select: none;
}

#window-controls .button:hover {
	background: rgba(255, 255, 255, 0.1);
}

#window-controls .button:active {
	background: rgba(255, 255, 255, 0.2);
}

#close-button:hover {
	background: #e81123 !important;
}

#close-button:active {
	background: #f1707a !important;
}
#close-button:active .icon {
	filter: invert(1);
}

#min-button {
	grid-column: 1;
}
#max-button,
#restore-button {
	grid-column: 2;
}
#close-button {
	grid-column: 3;
}

#restore-button {
	display: none !important;
}

.maximized #restore-button {
	display: flex !important;
}

.maximized #max-button {
	display: none;
}
